package com.math.util;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;

public class ColumnModel implements Serializable{

	/** id */
	private static final long serialVersionUID = 1L;
	
	private String header;
	private String property;

	public ColumnModel(String header, String property) {
		this.header = header;
		this.property = property;
	}

	public String getHeader() {
		return header;
	}

	public String getProperty() {
		return property;
	}
	
	public static List<ColumnModel> populateColumns(String[] columnKeys) {
		List<ColumnModel> cols = new ArrayList<ColumnModel>();
		
		for (String columnKey : columnKeys) {
			cols.add(new ColumnModel(columnKey.toUpperCase(), columnKey));
		}
		
		return cols;
	}
	
	public static List<ColumnModel> populateColumnsHM(Map<String,String> columnKeys) {
		List<ColumnModel> cols = new ArrayList<ColumnModel>();
		
		for (String key : columnKeys.keySet()) {
			cols.add(new ColumnModel(columnKeys.get(key),key));
		}
		
		return cols;
	}

}
